<?php
/* QM Promisance - Turn-based strategy game
 * Copyright (C) 2001-2011 QMT Productions
 *
 * $URL: https://qmpromisance.svn.sourceforge.net/svnroot/qmpromisance/promisance/tags/release-4_6/pages/logout.php $
 * $Id: logout.php 1880 2011-06-01 02:59:20Z Quietust $
 */

if (!defined('IN_GAME'))
	die("Access denied");

$auth = checkAuth(FALSE);
if ($auth != '')
	error_403('ERROR_TITLE_ACCESS', $auth);

// set locks for logging purposes
$lock['emp1'] = $emp1->e_id;
$lock['user1'] = $user1->u_id;
db_lockentities(array($user1, $emp1), $user1->u_id);
logevent();

$emp1->clrFlag(EFLAG_ONLINE);

$emp1->save();
$user1->save();
$db->releaseLocks();
prom_session::kill();

redirect(URL_HOMEPAGE);
?>
